package com.douwong.student.adapter;

import android.content.Context;
import android.view.View;

import com.bumptech.glide.Glide;
import com.douwong.student.R;
import com.douwong.student.model.AppInfos;
import com.douwong.student.model.Holder;

import java.util.ArrayList;


/**
 * @autor yichao
 * @time 2016/11/2314:03
 * @des ${TODO}
 */
public class OnLineStudyAdapter extends BaseAppAdapter {


    public void setOnLineList(ArrayList<AppInfos> onLineList) {
        mOnLineList = onLineList;
    }

    public OnLineStudyAdapter(ArrayList<AppInfos> onLineList, Context context) {
        super(onLineList,context);

    }

    @Override
    protected void setViewDate(Holder holder, ArrayList<AppInfos> onLineList, int position) {
        if (mOnLineList.size() > 0) {
            if (mOnLineList.get(position).appIcoDownloadUrl != null) {
                Glide.with(mContext).load(mOnLineList.get(position).appIcoDownloadUrl).placeholder(R.mipmap.answerdefault).into(holder.drawb);
                //   ImageLoader.getInstance().displayImage(mOnLineList.get(position).appIcoDownloadUrl,holder.drawb, DisplayImageOptionsUtil.getDefaultOption());
            }
            holder.title.setText(mOnLineList.get(position).appName);

            if (mOnLineList.get(position).ynControl == 1) {
                holder.pwd_on.setVisibility(View.VISIBLE);
            } else {
                holder.pwd_on.setVisibility(View.GONE);
            }
        }
    }







}
